load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "log",
    srcs = [
        "amazon.go",
        "context.go",
        "core.go",
        "doc.go",
        "encoders.go",
        "etcd.go",
        "field.go",
        "http.go",
        "kind.go",
        "level.go",
        "log.go",
        "loggers.go",
        "logrus.go",
        "pgx.go",
        "span.go",
        "stdlog.go",
        "step.go",
        "testing.go",
        "uuid.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/log",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/constants",
        "//src/internal/errors",
        "//src/protoextensions",
        "@com_github_adrg_xdg//:xdg",
        "@com_github_aws_aws_sdk_go//aws",
        "@com_github_fatih_color//:color",
        "@com_github_felixge_httpsnoop//:httpsnoop",
        "@com_github_go_logr_zapr//:zapr",
        "@com_github_google_go_cmp//cmp",
        "@com_github_jackc_pgx_v4//:pgx",
        "@com_github_satori_go_uuid//:go_uuid",
        "@com_github_sirupsen_logrus//:logrus",
        "@io_etcd_go_etcd_client_v3//:client",
        "@io_etcd_go_etcd_server_v3//embed",
        "@io_k8s_api//core/v1:core",
        "@io_k8s_klog_v2//:klog",
        "@io_k8s_sigs_kind//pkg/log",
        "@org_golang_google_grpc//grpclog",
        "@org_golang_google_grpc//metadata",
        "@org_golang_google_protobuf//encoding/protojson",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//types/known/anypb",
        "@org_golang_google_protobuf//types/known/durationpb",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_golang_google_protobuf//types/known/wrapperspb",
        "@org_golang_x_exp//maps",
        "@org_uber_go_atomic//:atomic",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
        "@org_uber_go_zap//zapgrpc",
        "@org_uber_go_zap//zapio",
        "@org_uber_go_zap//zaptest",
    ],
)

go_test(
    name = "log_test",
    size = "small",
    srcs = [
        "amazon_test.go",
        "benchmark_test.go",
        "context_test.go",
        "field_test.go",
        "http_test.go",
        "kind_test.go",
        "level_test.go",
        "log_test.go",
        "loggers_test.go",
        "logrus_test.go",
        "span_test.go",
        "step_test.go",
        "testing_test.go",
        "worker_test.go",
    ],
    embed = [":log"],
    deps = [
        "//src/pfs",
        "//src/pps",
        "//src/version/versionpb",
        "@com_github_google_go_cmp//cmp",
        "@com_github_sirupsen_logrus//:logrus",
        "@org_golang_google_protobuf//encoding/protojson",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//reflect/protoreflect",
        "@org_golang_google_protobuf//testing/protocmp",
        "@org_golang_google_protobuf//types/dynamicpb",
        "@org_golang_google_protobuf//types/known/anypb",
        "@org_golang_google_protobuf//types/known/durationpb",
        "@org_golang_google_protobuf//types/known/emptypb",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_golang_google_protobuf//types/known/wrapperspb",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
        "@org_uber_go_zap//zaptest",
    ],
)
